'======================================
' IgnoreCaseStrNextTable
'======================================
Private Sub test_IgnoreCaseStrNextTable_str()
    Dim icNextTable As IgnoreCaseStrNextTable
    Set icNextTable = New IgnoreCaseStrNextTable
    icNextTable.Init "aAcd"

    Dim nextTable As IStringNextTable
    Set nextTable = icNextTable

    Debug.Assert nextTable.Str = "aAcd"
End Sub

Private Sub test_IgnoreCaseStrNextTable_Length()
    Dim icNextTable As IgnoreCaseStrNextTable
    Set icNextTable = New IgnoreCaseStrNextTable
    icNextTable.Init "abcd"

    Dim nextTable As IStringNextTable
    Set nextTable = icNextTable

    Debug.Assert nextTable.Length = 4
End Sub

Private Sub test_IgnoreCaseStrNextTable_startWith()
    Dim icnt1 As IgnoreCaseStrNextTable
    Set icnt1 = New IgnoreCaseStrNextTable
    icnt1.Init "abCd"

    Dim icnt2 As IgnoreCaseStrNextTable
    Set icnt2 = New IgnoreCaseStrNextTable
    icnt2.Init "abC"

    Dim icnt3 As IgnoreCaseStrNextTable
    Set icnt3 = New IgnoreCaseStrNextTable
    icnt3.Init "abc"

    Dim nt1 As IStringNextTable
    Set nt1 = icnt1
    Dim nt2 As IStringNextTable
    Set nt2 = icnt2
    Dim nt3 As IStringNextTable
    Set nt3 = icnt3

    Debug.Assert nt1.startWith(nt2) = True
    Debug.Assert nt1.startWith(nt3) = True
End Sub

Private Sub test_IgnoreCaseStrNextTable_startWithStr()
    Dim icnt1 As IgnoreCaseStrNextTable
    Set icnt1 = New IgnoreCaseStrNextTable
    icnt1.Init "abCd"

    Dim nt1 As IStringNextTable
    Set nt1 = icnt1

    Debug.Assert nt1.startwithStr("abC") = True
    Debug.Assert nt1.startwithStr("abc") = True
End Sub

Private Sub test_IgnoreCaseStrNextTable_getActiveChar()
    Dim icNextTable As IgnoreCaseStrNextTable
    Set icNextTable = New IgnoreCaseStrNextTable
    icNextTable.Init "aBcd"

    Dim nextTable As IStringNextTable
    Set nextTable = icNextTable

    nextTable.setActiveIndex (1)
    Debug.Assert nextTable.getActiveChar() = "b"
    Debug.Assert nextTable.getActiveChar() <> "B"
    nextTable.setActiveIndex (2)
    Debug.Assert nextTable.getActiveChar() = "c"
    Debug.Assert nextTable.getActiveChar() <> "C"
End Sub

Private Sub test_IgnoreCaseStrNextTable_setActiveChar()
    Dim icNextTable As IgnoreCaseStrNextTable
    Set icNextTable = New IgnoreCaseStrNextTable
    icNextTable.Init "abCd"

    Dim nextTable As IStringNextTable
    Set nextTable = icNextTable

    nextTable.setActiveIndex (2)
    Debug.Assert nextTable.getActiveChar() = "c"
End Sub

Private Sub test_IgnoreCaseStrNextTable_toNextActiveIndex()
    Dim icNextTable As IgnoreCaseStrNextTable
    Set icNextTable = New IgnoreCaseStrNextTable
    icNextTable.Init "abCd"

    Dim nextTable As IStringNextTable
    Set nextTable = icNextTable

    nextTable.setActiveIndex (2)
    nextTable.toNextActiveIndex
    Debug.Assert nextTable.ActiveIndex = 3
End Sub

Private Sub test_IgnoreCaseStrNextTable_isWholeMatched()
    Dim icNextTable As IgnoreCaseStrNextTable
    Set icNextTable = New IgnoreCaseStrNextTable
    icNextTable.Init "aaBaaC"

    Dim nextTable As IStringNextTable
    Set nextTable = icNextTable

    nextTable.matchChar "a"
    nextTable.matchChar "a"
    nextTable.matchChar "b"
    nextTable.matchChar "a"
    nextTable.matchChar "a"
    nextTable.matchChar "B"
    Debug.Assert nextTable.isWholeMatched = False

    nextTable.matchChar "a"
    nextTable.matchChar "a"
    nextTable.matchChar "c"
    Debug.Assert nextTable.isWholeMatched = True
End Sub

Private Sub test_IgnoreCaseStrNextTable_reset()
    Dim icNextTable As IgnoreCaseStrNextTable
    Set icNextTable = New IgnoreCaseStrNextTable
    icNextTable.Init "abcd"

    Dim nextTable As IStringNextTable
    Set nextTable = icNextTable

    nextTable.setActiveIndex (2)
    Debug.Assert nextTable.ActiveIndex = 2

    nextTable.reset
    Debug.Assert nextTable.ActiveIndex = 0
End Sub

Private Sub test_IgnoreCaseStrNextTable_equalActiveChar()
    Dim icNextTable As IgnoreCaseStrNextTable
    Set icNextTable = New IgnoreCaseStrNextTable
    icNextTable.Init "abCd"

    Dim nextTable As IStringNextTable
    Set nextTable = icNextTable

    nextTable.setActiveIndex (1)
    Debug.Assert nextTable.equalActiveChar("B") = True
    Debug.Assert nextTable.equalActiveChar("b") = True
    Debug.Assert nextTable.equalActiveChar("C") = False
    nextTable.setActiveIndex (2)
    Debug.Assert nextTable.equalActiveChar("c") = True
    Debug.Assert nextTable.equalActiveChar("C") = True
    Debug.Assert nextTable.equalActiveChar("b") = False
End Sub

